{include="header"}
{include="navigator"}

<div id = "container">
	<div class = "sidebar-sar">
		<ul>
			{loop="page"}
			<li><a href="sar.php?id={$value.id}">{$value.page}</a></li>
			{/loop}
		</ul>
	</div>

	<div id = "sar" class = "center">
		<h1 class = "topic">{$page[$id]['page']}</h1>

		{if="$id==6 || $id==7"}
		<a href = "staff-form.php?page={$id}">เพิ่มรายชื่อ</a>
		<table cellpadding = "0" cellspacing = "0" border = "0" class = "list">
			<tr>
				<td class = "w150">รูป</td>
				<td class = "w200">ชื่อ นามสกุล</td>
				<td class = "w150">ตำแหน่ง</td>
				{if="$user['level_name']=='officer'"}
					<td>เครื่องมือ</td>
				{/if}
			</tr>
			{loop="staff"}
			<tr>
				<td><img src = "{$value.picture}"></td>
				<td>{$value.name}</td>
				<td>{$value.position}</td>
				{if="$user['level_name']=='officer'"}
				<td>
					<a href = "staff-edit.php?id={$value.id}&page={$id}" alt = "แก้ไข" title = "แก้ไข"><img src="images/icon/edit.png"></a>
					<a href = "staff-delete.php?id={$value.id}&page={$id}" alt = "ลบ" title = "ลบ" class = "delete"><img src="images/icon/delete.png"></a>
				</td>
				{/if}
			</tr>
			{/loop}
		</table>

		{else}

		<form action = "sar-update.php" method = "post">
			<input type = "hidden" name = "id" value = "{$id}">
			<div class = "content">
				{if="$user['level_name']=='officer'"}
					<textarea class = "mce" name = "detail" style = "width:500px; height:200px;">{$page[$id]['detail']}</textarea>
					<br>
					<input type = "submit" value = "ปรับปรุงข้อมูล">
				{else}
					{$page[$id]['detail']}
				{/if}
			</div>
		</form>
		{/if}
		
	</div>
	<div class = "clear"></div>
</div>

{include="footer"}